package ray.mgocc.title;

import ray.mgocc.Time;
import ray.mgocc.Score;

public class Rat extends WeekTitle{

    public void init(){
        super.init();
        add(new TrapRequirement());
    }
    protected int getPlayTimeThreshold(){return 3;}
    public int getPriority(){ return 18; }

    class TrapRequirement extends Requirement{
        public String getName(){return "trap";}
        private int getTrapCount(){
            return getValue("Personal Scores.Times Caught in Trap");
        }
        private double needTrapCount(){
            return ((double)getRound()/5);
        }
        public double getRatio(){
            return ((double)getTrapCount())/needTrapCount();
        }
        public String toString(){
            return super.toString()+"("+format(needTrapCount())+"<="+format(getTrapCount())+")";
        }
    }

}

